package com.ruoyi.stock.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.stock.mapper.StockInventoryMapper;
import com.ruoyi.stock.domain.StockInventory;
import com.ruoyi.stock.service.IStockInventoryService;
import com.ruoyi.common.core.text.Convert;

/**
 * 库存信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-17
 */
@Service
public class StockInventoryServiceImpl implements IStockInventoryService 
{
    @Autowired
    private StockInventoryMapper stockInventoryMapper;

    /**
     * 查询库存信息
     * 
     * @param inventoryId 库存信息主键
     * @return 库存信息
     */
    @Override
    public StockInventory selectStockInventoryByInventoryId(Long inventoryId)
    {
        return stockInventoryMapper.selectStockInventoryByInventoryId(inventoryId);
    }

    /**
     * 查询库存信息列表
     * 
     * @param stockInventory 库存信息
     * @return 库存信息
     */
    @Override
    public List<StockInventory> selectStockInventoryList(StockInventory stockInventory)
    {
        return stockInventoryMapper.selectStockInventoryList(stockInventory);
    }

    /**
     * 新增库存信息
     * 
     * @param stockInventory 库存信息
     * @return 结果
     */
    @Override
    public int insertStockInventory(StockInventory stockInventory)
    {
        return stockInventoryMapper.insertStockInventory(stockInventory);
    }

    /**
     * 修改库存信息
     * 
     * @param stockInventory 库存信息
     * @return 结果
     */
    @Override
    public int updateStockInventory(StockInventory stockInventory)
    {
        return stockInventoryMapper.updateStockInventory(stockInventory);
    }

    /**
     * 批量删除库存信息
     * 
     * @param inventoryIds 需要删除的库存信息主键
     * @return 结果
     */
    @Override
    public int deleteStockInventoryByInventoryIds(String inventoryIds)
    {
        return stockInventoryMapper.deleteStockInventoryByInventoryIds(Convert.toStrArray(inventoryIds));
    }

    /**
     * 删除库存信息信息
     * 
     * @param inventoryId 库存信息主键
     * @return 结果
     */
    @Override
    public int deleteStockInventoryByInventoryId(Long inventoryId)
    {
        return stockInventoryMapper.deleteStockInventoryByInventoryId(inventoryId);
    }
}
